export const IndexRoutes = [{
  path: '/',
  component: resolve => require(["./index.component.vue"], resolve),
  children: [{
    path: 'wechat',
    name: '授权页',
    component: resolve => require(["../getWechatCode.vue"], resolve),
    meta:{
      level:1
    }
  },{
    path: 'index',
    name: '首页',
    component: resolve => require(["../index.vue"], resolve),
    meta:{
      level:1
    },
    beforeRouteLeave (to, from , next) {
      const answer = window.confirm('Do you really want to leave? you have unsaved changes!')
      if (answer) {
        next()
      } else {
        next(false)
      }
    }
  },{
    path: 'onlineOrder',
    name: '在线下单',
    component: resolve => require(["../onlineOrder.vue"], resolve),
    meta:{
      level:2,
      keepAlive: true // true 表示需要使用缓存 false表示不需要被缓存
    }
  },{
    path: 'choice',
    name: '选择商品',
    component: resolve => require(["../choice.vue"], resolve),
    meta:{
      level:3
    }
  },{
    path: 'address',
    name: '选择地址',
    component: resolve => require(["../address.vue"], resolve),
    meta:{
      level:3
    }
  },{
    path: 'addressForm',
    name: '地址信息',
    component: resolve => require(["../addressForm.vue"], resolve),
    meta:{
      level:4
    }
  },{
    path: 'orderList',
    name: '我的订单',
    component: resolve => require(["../orderList.vue"], resolve),
    meta:{
      level:2
    }
  },{
    path: 'orderDetail',
    name: '订单详情',
    component: resolve => require(["../orderDetail.vue"], resolve),
    meta:{
      level:3
    }
  },{
    path: 'sign',
    name: '签收',
    component: resolve => require(["../sign.vue"], resolve),
    meta:{
      level:2
    }
  },{
    path: 'editTime',
    name: '修改订单',
    component: resolve => require(["../editTime.vue"], resolve),
    meta:{
      level:3
    }
  },{
    path: 'serverAssess',
    name: '发表评价',
    component: resolve => require(["../serverAssess.vue"], resolve),
    meta:{
      level:3
    }
  },{
    path: 'claim',
    name: '申请理赔',
    component: resolve => require(["../claim.vue"], resolve),
    meta:{
      level:2
    }
  },{
    path: 'bridge',
    name: '扫描处理页面',
    component: resolve => require(["../scanBridge.vue"], resolve),
    meta:{
      level:2
    }
  },{
    path: 'transaddress',
    name: '中转地址',
    component: resolve => require(["../transaddress.vue"], resolve),
    meta:{
      level:3
    }
  },{
    path: 'transaddressForm',
    name: '中转地址编辑',
    component: resolve => require(["../transaddressForm.vue"], resolve),
    meta:{
      level:4
    }
  },{
    path: 'cmxindex',
    name: '订单首页',
    component: resolve => require(["../cmxindex.vue"], resolve),
    meta:{
      level:4
    }
  },{
    path: 'cmxlist',
    name: '订单受理',
    component: resolve => require(["../cmxlist.vue"], resolve),
    meta:{
      level:4
    }
  }]
}]